<?php

class Model_Item_stats {

    protected $item_id;
    protected $num_views;
    protected $num_spam;
    protected $num_repeated;
    protected $num_bad_classified;
    protected $num_offensive;
    protected $num_expired;
    protected $num_premium_views;
    protected $dt_date;

    public function __construct(array $options = null) {
        if (is_array($options)) {
            $this->setOptions($options);
        }
    }

    public function __set($name, $value) {
        $method = 'set' . ucfirst($name);
        if (('mapper' == $name) || !method_exists($this, $method)) {
            throw new Exception('Invalid content property');
        }
        $this->$method($value);
    }

    public function __get($name) {
        $method = 'get' . ucfirst($name);
        if (('mapper' == $name) || !method_exists($this, $method)) {
            throw new Exception('Invalid content property');
        } return $this->$method();
    }

    public function setOptions(array $options) {
        $methods = get_class_methods($this);
        foreach ($options as $key => $value) {
            $method = 'set' . ucfirst($key);
            if (in_array($method, $methods)) {
                $this->$method($value);
            }
        }
    }

    public function setItem_id($value) {
        $this->item_id = $value;
    }

    public function getItem_id() {
        return $this->item_id;
    }

    public function setNum_views($value) {
        $this->num_views = $value;
    }

    public function getNum_views() {
        return $this->num_views;
    }

    public function setNum_spam($value) {
        $this->num_spam = $value;
    }

    public function getNum_spam() {
        return $this->num_spam;
    }

    public function setNum_repeated($value) {
        $this->num_repeated = $value;
    }

    public function getNum_repeated() {
        return $this->num_repeated;
    }

    public function setNum_bad_classified($value) {
        $this->num_bad_classified = $value;
    }

    public function getNum_bad_classified() {
        return $this->num_bad_classified;
    }

    public function setNum_offensive($value) {
        $this->num_offensive = $value;
    }

    public function getNum_offensive() {
        return $this->num_offensive;
    }

    public function setNum_expired($value) {
        $this->num_expired = $value;
    }

    public function getNum_expired() {
        return $this->num_expired;
    }

    public function setNum_premium_views($value) {
        $this->num_premium_views = $value;
    }

    public function getNum_premium_views() {
        return $this->num_premium_views;
    }

    public function setDt_date($value) {
        $this->dt_date = $value;
    }

    public function getDt_date() {
        return $this->dt_date;
    }

    public function toArray() {
        return get_object_vars($this);
    }

}

